<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="keywords" content="pinpin社保" />
	<meta name="description" content="pinpin社保" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>社保运营后台-流水</title>
	<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
</head>
<body>
	<div id="wrapper">
        <%@ include file="/WEB-INF/jsp/common/menu.jsp" %>
        <div id="page-wrapper">
        	<div class="row">
                <div class="col-lg-12">
                    <!-- 路径导航 -->
                    <ol class="breadcrumb">
				      <li>社保后台</li>
				      <li><a href="${month_list_uri }">月流水</a></li>
				      <li class="active">月度的各城市流水</li>
				    </ol>
                </div>
            </div>
            <div class="row">
            	<div class="col-lg-12">
            		<div class="panel panel-default">
            			<div class="panel-body">
        			    	<div class="form-inline dt-bootstrap no-footer">
        			    		<!-- 表单查询 -->
        			    		<div class="row">
        			    			<div class="col-lg-10">
        			    			<form action="" method="POST" class="form-check" id="queryOrderForm">
        			    			    <label class="control-label"> 城市：</label>
                                        <c:set var="citySelectPCitys" value="${pCityList }" scope="request"/>
                                        <c:set var="citySelectCitys" value="${cityList }" scope="request"/>
                                        <jsp:include page="/WEB-INF/jsp/common/citySelect.jsp">
                                        	<jsp:param name="id" value="city_code" />
                                        	<jsp:param name="name" value="city_code" />
                                        	<jsp:param name="value" value="${city_code }" />
                                        </jsp:include>
                                        <label class="control-label">月份：</label>
                                        <select class="form-control"  name="month">
                                        	<option value="0" ${month==ml ? "selected" : "" }>不限制月份</option>
        			    					<c:forEach var="ml" items="${monthList }">
                                        		<option value="${ml }" ${month==ml ? "selected" : "" }>${ml }</option>
                                        	</c:forEach>
                                        </select>
        			    			    <button type="submit" class="btn btn-primary">查 询</button>
        			    			    <button type="button" id="resetBtn" class="btn btn-primary">重置</button>
                                        <label class="control-label">记录数：${count }</label>
        			    			</form>
        			    			</div>
					    		    <div class="col-lg-2">
						    			<button class="btn btn-primary btn-sm" onclick="javascript:exportExcel();">导出为EXCEL</button>
					    			</div>
        			    		</div>
        			    		<!-- 表格列表 -->
        			    		<div class="row">
        			    			<div class="col-lg-12">
        			    				<table id="dataContent" class="table table-striped table-bordered table-hover no-footer" role="grid">
        			    					<thead>
        			    						<tr>
                                                    <th>城市</th>
                                                    <th>社保、公积金汇总</th>
                                                    <th>社保汇总</th>
                                                    <th>公积金汇总</th>
                                                </tr>
        			    					</thead>
        			    					<tbody>
        			    					<c:forEach var="m" items="${monthCitys }">
        			    					<tr role="row">
        			    						<td>
        			    							<p><label>${m.city_name } ${m.monthAmount.for_month }</label></p>
			   										<p>${m.monthAmount.update_time }</p>
        			    						</td>
        			    						<td style="text-align:left">
						   							<p>有效订单数：${m.monthAmount.order_num }</p>
						   							<p>有效总金额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.total_amount }"/></p>
						    						<p>全额退款订单数：${m.monthAmount.refund_order_num }</p>
						   							<p>退款金额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.total_refund_amount }"/></p>
						   							<p>优惠券金额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.total_discount_amount }"/></p>
						   							<p>已补差额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.total_repay_amount }"/></p>
						   							<p>需补差额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.total_need_repay_amount }"/></p>
						   							<p>实际利润：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.total_actual_amount }"/></p>
						   						</td>
						   						<td style="text-align:left">
						   							<p>有效订单数：${m.monthAmount.shebao_order_num }</p>
						    						<p>社保费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_amount - m.monthAmount.shebao_disabled_price }"/></p>
						    						<p>残保金：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_disabled_price }"/></p>
						    						<p>社保预收费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_pre_charge }"/></p>
													<p>部分退款金额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_partial_refund }"/></p>
													<p>服务费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_charge_amount }"/></p>
						   							<p>办卡费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_card_amount }"/></p>
						   							<p>已补差额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_repay_amount }"/></p>
						   							<p>需补差额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_need_repay_amount }"/></p>
													<p>服务费退费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_charge_refund }"/></p>
													<p>制卡费退费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.shebao_card_charge }"/></p>
						   						</td>
						   						<td style="text-align:left">
						   							<p>有效订单数：${m.monthAmount.fund_order_num }</p>
						    						<p>缴纳金额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.fund_amount }"/></p>
													<p>部分退款金额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.fund_partial_refund }"/></p>
													<p>服务费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.fund_charge_amount }"/></p>
													<p>已补差额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.fund_repay_amount }"/></p>
													<p>需补差额：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.fund_need_repay_amount }"/></p>
													<p>服务费退费：￥<fmt:formatNumber pattern="##,###.00" value="${m.monthAmount.fund_charge_refund }"/></p>
						   						</td>
        			    					</tr>
        			    					</c:forEach>
        			    					</tbody>
        			    				</table>
        			    				
        			    			</div>
        			    		</div>
        			    	</div>
            			</div>
            		</div>
            	</div>
            </div>
        </div>
	</div>
</body>
<script type="text/javascript">
	var month_city_export_uri = "${month_city_export_uri}";
	function exportExcel() {
		var form = $("#queryOrderForm");
		form.attr("action", month_city_export_uri);
		form.submit();
		form.attr("action", "");
	}
</script>
</html>